<?php

namespace App\Model;

use App\Dao\BaseDao;

class UsersStockModel extends BaseModel
{
    protected $table = 'user_stock';
    protected $fillable = [
        'user_id',
        'project_id',
        'nums',
        'category_id',
    ];

    public function goods(): \Illuminate\Database\Eloquent\Relations\HasMany
    {
        return $this->hasMany(ProjectsModel::class,'project_id','project_id');
    }

    public function userInfo(): \Illuminate\Database\Eloquent\Relations\HasOne
    {
        return $this->hasOne(UsersModel::class,'user_id','user_id');
    }
}
